package com.example.sources.servlet;

import com.example.sources.annotation.PathVariable;
import com.example.sources.annotation.RequestParam;

import java.lang.reflect.Method;
import java.lang.reflect.Parameter;
import java.util.HashMap;
import java.util.Map;

/**
 * Created by Administrator on 2016/9/20.
 */
public class MethodParamter {
    private Map<String,Object> paramterMap = new HashMap<>();
    public Map<String,Object> getParamterMap(){
        return paramterMap;
    }
    public void putParameter(String name,Object obj){
        paramterMap.put(name,obj);
    }
    public Object getParamterValue(String name){
        return paramterMap.get(name);
    }

    public void setParamter(Method method,String url){
        for (Parameter parameter:method.getParameters()){
            if (parameter.getAnnotation(RequestParam.class)!= null){

            }else if (parameter.getAnnotation(PathVariable.class)!= null){

            }else {

            }
        }
    }
}
